package net.wanho.ems.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.ems.entity.Dept;
import net.wanho.ems.service.DeptService;
import net.wanho.ems.vo.AjaxResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author：汤小洋
 * Date：2023-07-10 17:02
 * Description：<描述>
 */
@RestController
@RequestMapping("/dept")
@RequiredArgsConstructor
public class DeptController {

    private final DeptService deptService;

    @RequestMapping("/findAll")
    public AjaxResult findAll(){
        List<Dept> depts = deptService.findAll();
        return AjaxResult.success(depts);
    }

}
